#pragma once

#include <string>
#include <GL\glui.h>

using namespace std;

class Material
{
private:
	string ID;
	GLfloat emission[4];
	GLfloat ambient[4];
	GLfloat difuse[4];
	GLfloat specular[4];
	GLfloat shininess;

public:
	Material() {}
	string getID()
	{
		return ID;
	}
	void setID(string _ID)
	{
		ID = _ID;
	}
	void setEmission(GLfloat _r, GLfloat _g, GLfloat _b, GLfloat _a)
	{
		emission[0] = _r;
		emission[1] = _g;
		emission[2] = _b;
		emission[3] = _a;
	}
	void setAmbient(GLfloat _r, GLfloat _g, GLfloat _b, GLfloat _a)
	{
		ambient[0] = _r;
		ambient[1] = _g;
		ambient[2] = _b;
		ambient[3] = _a;
	}
	void setDifuse(GLfloat _r, GLfloat _g, GLfloat _b, GLfloat _a)
	{
		difuse[0] = _r;
		difuse[1] = _g;
		difuse[2] = _b;
		difuse[3] = _a;
	}
	void setSpecular(GLfloat _r, GLfloat _g, GLfloat _b, GLfloat _a)
	{
		specular[0] = _r;
		specular[1] = _g;
		specular[2] = _b;
		specular[3] = _a;
	}
	void setShininess(GLfloat s)
	{
		shininess = s;
	}
	void applyMaterial()
	{
		glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &shininess);
		glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,  specular);
		glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,   difuse);
		glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,   ambient);
		glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION,  emission);
	}
};